A lottery worker in Iowa, who secretly installed code in the company's systems to enable him to pick winning numbers, may be jailed for up to 25 years.